function toUTF8(szInput){ 
 var wch,x,uch="",szRet="";
 for (x=0; x<szInput.length; x++){
  wch=szInput.charCodeAt(x);
  if (!(wch & 0xFF80)){
   szRet += szInput.charAt(x);
  }
  else if (!(wch & 0xF000)){
   uch = "%" + (wch>>6 | 0xC0).toString(16) + 
      "%" + (wch & 0x3F | 0x80).toString(16);
   szRet += uch; 
  }
  else{
   uch = "%" + (wch >> 12 | 0xE0).toString(16) + 
      "%" + (((wch >> 6) & 0x3F) | 0x80).toString(16) +
      "%" + (wch & 0x3F | 0x80).toString(16);
   szRet += uch; 
  }
 }
 return(szRet);
}

	function getzb(){
	var o=document.getElementById("tbenname");
		new Ajax.Updater("ajaxDiv",toUTF8("ajaxZb.do"),{method: "post",parameters: "tbenname=" + o.value,evalScripts:true});
	}
	function checkType(){
		var zbm=document.getElementById("zbm");
		if(zbm.options[document.getElementById("zbm").selectedIndex].id=="int"){
			var cs=document.getElementById("cs");
			if(isNaN(cs.value)){
				alert("请输入整型数字");
				cs.value="";
				cs.focus();
			}
		}
	}
	
	function checkType2(){
	
		var zbm2=document.getElementById("zbm2");
		if(zbm2.options[document.getElementById("zbm2").selectedIndex].id=="int"){
			var cs=document.getElementById("cs2");
			if(isNaN(cs.value)){
				alert("请输入整型数字");
				cs.value="";
				cs.focus();
			}
		}
		//else if(zbm2.options[document.getElementById("zbm2").selectedIndex].id=="bigint"){
			//var cs=document.getElementById("cs2");
			//var patrn=/^\d{4}-\d{2}-\d{2}$/;
			////if(!patrn.exec(cs.value)){
				////alert("请输入时间格式，如:1999-12-21");
				////cs.value="";
			////	cs.focus();
			////}
			//document.getElementById("cs").style.display="none";
           // document.getElementById("bm").style.display="none";
          //  document.getElementById("rq").style.display="block";
		//}
	}